// 初始化下载控件
function initUploader() {
    var uploader = new plupload.Uploader({
        runtimes: 'flash,html5',
        browse_button: 'browseBtn',
        max_file_size: fileSizeLimit,
        file_data_name: 'upfile',
        multi_selection:false,
        url: AGENCYWEB_PATH + 'car/commonUpload',
        flash_swf_url:  AGENCYWEB_PATH + 'static/js/common/ftp/Moxie.swf',
        filters: [
            {title: "Image files", extensions: "jpg,gif,bmp"}
        ], init: {
            Init: initHandler,
            FileFiltered: fileFilteredHandler,
            FilesAdded: filesAddedHandler,
            BeforeUpload: beforeUploadHandler,
            UploadProgress: uploadProgressHandler,
            FileUploaded: fileUploadedHandler,
            UploadComplete:uploadCompleteHandler,
            Error: errorHandler
        }, multipart_params: {
            modelType: modelType
        }
    });

    uploader.init();

    $('#uploadBtn').click(function () {
    	 var chunnel = $("#txtFileName").val();//获取浏览文本边框中的字符串
         if(chunnel == ""){
             alert("上传文件不能为空,请修改后上传!");
             return false;
         }
        uploader.start();
    });
}



$(function() {
    modelType=$("#modelType").val();

    initUploader();
    showPicture($("#path").val());
});







